package gamebackend;

/**
 * <p> Used for telling FlightPaths where to fly.
 * 
 * </p><p> A ShipFlier is obtained from a FlightPath.
 * Both the ShipFlier and FlightPath share a common
 * Ship.  The ShipFlier can direct where the Ship
 * goes, and the FlightPath steps the ship and 
 * asks for its position.  Other Fliers can
 * tell the ShipFlier what to do
 * 
 * </p><p> Fliers can form a tree structure,
 * so that parents direct their child or children
 * where to go, and the children decide how
 * to go to the target.
 * </p>
 * 
 * @author Jonathan Caddey
 */
public interface Flier {

	/**
	 * Fliers are responsible for calling
	 * step on any of their children, so that
	 * step must only be called on the root Flier.
	 * @param the_yChange how far the Flier should fly.
	 */
	void step(final double the_yChange);
	
	/**
	 * Not all Fliers need to maintain a valid target.
	 * @param the_target the x position of where to fly.
	 */
	void setTarget(final double the_target);
	
	/**
	 * Not all Fliers need to maintain a valid target.
	 * @return the_target the x position of where to fly.
	 */
	double getTarget();
	boolean isAtTarget();
	
	
	/**
	 * Not all Fliers need to return a valid position, such
	 * as a Flier that controls two different Fliers.
	 * @return the position of the Ship.
	 */
	double getPosition();
	
	/**
	 * @return the Flier this Flier controls.  May be null.
	 */
	Flier getChild();
}
